import { EAreaID } from "../constant/GameEnum";
import PokerGroupVo from "./PokerGroupVo";
import PokerVo from "./PokerVo";

export default class ReceivePokerGroupVo extends PokerGroupVo {
  private _groupIndex: number = -1;
  constructor(areaID: EAreaID = EAreaID.RECEIVE) {
    super(areaID);
  }
  public get groupIndex(): number {
    return this._groupIndex;
  }
  public set groupIndex(v: number) {
    this._groupIndex = v;
  }
  public isNextPoker(poker: PokerVo): boolean {
    // if (poker.suit != this.groupIndex) {
    //   return false;
    // }
    if (this.pokers.length <= 0) {
      if (poker.point == 1) {
        return true;
      }
    } else {
      if (this.topPoker.point + 1 == poker.point && this.topPoker.suit == poker.suit) {
        return true;
      }
    }
    return false;
  }
}
